import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'Login',
    component: () => import('../views/Login')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/Home'),
    redirect: '/index/index',
    children: [
      { path: '/index/index', component: () => import('../views/index/index') },//后台首页
      { path: '/student/index', component: () => import('../views/student/index') },//学员管理
      { path: '/class/index', component: () => import('../views/class/index') },//班级管理
      { path: '/attendance/index', component: () => import('../views/attendance/index') },//考勤管理
      { path: '/hour/index', component: () => import('../views/hour/index') },//课程汇总
      { path: '/course/index', component: () => import('../views/course/index') },//课程管理
      { path: '/classroom/index', component: () => import('../views/classroom/index') },//教室管理
      { path: '/teacher/index', component: () => import('../views/teacher/index') },//教师管理
      { path: '/account/index', component: () => import('../views/account/index') },//账号管理
      { path: '/campus/index', component: () => import('../views/campus/index') },//校区管理
    ]

  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
